<template>
<div>
    <div class="common-form">
      <span>{{curItem.name}}</span>
    </div>
    <el-form size="small" :model="curItem" label-width="100px">
      <div class="f16 gray3 form-subtitle">{{$t('page.style_setting')}}</div>
      <!--底边距-->
      <div class="form-item">
        <div class="form-label">{{$t('page.margin_bottom')}}</div>
        <el-slider
          v-model="curItem.style.bottom"
          size="small"
          show-input
          :show-input-controls="false"
          input-size="small"
        ></el-slider>
      </div>
      <!--右边距-->
      <div class="form-item">
        <div class="form-label">{{$t('page.margin_right')}}</div>
        <el-slider
          v-model="curItem.style.right"
          size="small"
          show-input
          :show-input-controls="false"
          input-size="small"
        ></el-slider>
      </div>
      <!--不透明度-->
      <div class="form-item">
        <div class="form-label">{{$t('page.opacity')}}</div>
        <el-slider
          v-model="curItem.style.opacity"
          size="small"
          show-input
          :show-input-controls="false"
          input-size="small"
        ></el-slider>
      </div>
      <!--客服类型-->
      <el-form-item :label="$t('page.customer_service_type')">
        <el-radio-group v-model="curItem.params.type">
          <el-radio :label="'chat'">{{$t('page.chat_online')}}</el-radio>
          <el-radio :label="'phone'">{{$t('page.phone_call')}}</el-radio>
          <el-radio :label="'wx'">{{$t('page.wechat_customer')}}</el-radio>
        </el-radio-group>
      </el-form-item>
      <el-form-item :label="$t('page.phone_number')">
        <el-input v-model="curItem.params.phoneNum"></el-input>
        <div>{{$t('page.fallback_notice')}}</div>
      </el-form-item>
      <!--客服图标-->
      <el-form-item :label="$t('page.customer_icon')">
        <div class="diy-service-icon">
          <img
            v-img-url="curItem.params.image"
            alt=""
            @click="$parent.onEditorSelectImage(curItem.params, 'image')"
          />
        </div>
        <div>{{$t('page.size_tip_90x90')}}</div>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  data() {
    return {};
  },
  props: ["curItem", "selectedIndex", "opts"],
  created() {
    this.curItem.style.bottom = parseInt(this.curItem.style.bottom);
    this.curItem.style.right = parseInt(this.curItem.style.right);
    this.curItem.style.opacity = parseInt(this.curItem.style.opacity);
  },
  methods: {}
};
</script>

<style lang="scss" scoped>
.diy-service-icon,
.diy-service-icon img {
  width: 40px;
  height: 40px;
}
</style>

